package banco;

import java.sql.ResultSet;
import java.sql.SQLException;

public class Queries {
	
	Conexao conexao = Conexao.getInstance();
	
	public void inserir(String tabela, String valores) throws SQLException{
		String insert = "INSERT INTO "+ tabela + " VALUES (" + valores + ");";
		System.out.println(insert);
		conexao.executaSQL(insert);		
	}
	
	public ResultSet consultar(String tabela, String condicao) throws SQLException{
		String select= "SELECT * FROM "+ tabela + " WHERE " + condicao + ";";
	//	System.out.println(select);
		return conexao.executaConsultaSQL(select);	
	}
	
	public void remover(String tabela, String condicao) throws SQLException{
		String delete = "DELETE FROM "+ tabela + " WHERE " + condicao + ";";
		System.out.println(delete);
		conexao.executaSQL(delete);	
	}
	
	
}
